<template>
    <CommonPage :tableConfig="option" formKey="loanList"></CommonPage>
    <ElDialog v-model="dialog" width="600px" title="详情">
        <LoanListDetail :rowInfo="rowInfo"/>
    </ElDialog>
</template>
<script setup>
import CommonPage from '@/components/CommonPage/index.vue'
import LoanListDetail from './components/loanListDetail.vue'
import { reactive, ref } from 'vue';
import {ElDialog } from 'element-plus'

const dialog = ref(false)
const rowInfo = ref()
const option = reactive({
    formItems: [
        {label: '客户企业名称', prop: 'fileName', type: 'input', show: true},
        {label: '渠道名称', prop: 'fileName', type: 'input', show: true},
        {label: '产品名称', prop: 'fileName', type: 'input', show: true},
        {label: '电商平台', prop: 'fileName', type: 'input', show: true},
        {label: '电商平台', prop: 'fileName', type: 'select', show: true, options:[
            {label: '抖音', value: 1},
            {label: '京东', value: 2},
            {label: '淘宝', value: 3},
            {label: '拼多多', value: 4},
            {label: '有赞', value: 5},
        ]},
        {label: '订单状态', prop: 'fileName', type: 'select', show: true, options:[
            {label: '已收单', value: 1},
            {label: '取数中', value: 2},
            {label: '待受理', value: 3},
            {label: '已受理', value: 4},
            {label: '已完成', value: 5},
        ]},
    ],
    buttons: [
        {label: "导出", icon: 'Download', auth: '', handle: (event)=> {}},
    ],
    options: [
        {label: '详情', handle: (event) => {handleDetail(event)}, isShow:() => {return true}},
    ],
    tableData:[{name:'sa'}]
})
// 查看详情
const handleDetail = (info) => {
    console.log(info);
    rowInfo.value = info
    dialog.value = true
}
</script>